<?php
$name = $_POST['name'];
$password = $_POST['password'];
$link = mysqli_connect("149.129.94.81","student","student","student");
if($link){
	$result = mysqli_query($link,"select * from teacher where account = '{$name}'");
	$data = mysqli_fetch_all($result,MYSQLI_ASSOC);
	
	if($data){
		if($data[0]['password'] == $password){
			$loginInfo = [
				"code" => 0,
				"msg" => "登录成功"
			];
			echo json_encode($loginInfo,1);die;
		}
	}
}
$loginInfo =[
	"code" = 1,
	"msg" => "登录失败"
];
echo json_encode($loginInfo,1);die;